
local skynet = require "skynet"
require "skynet.manager"
local sharedata = require "skynet.sharedata"
local datacenter = require "skynet.datacenter"

local CMD = {}
local wsgate

function CMD.init()
    wsgate = skynet.uniqueservice("wsgate")

end

function CMD.kick()
    return true
end


function updateDay(  )
    
    -- wsgate


end

skynet.start(function()

    
    sharedata.new("item",require "db_item")
   
    local db = require "db_global"
    datacenter.set("matchtimemax",db["1"].value)
   
    local redpacketd = skynet.uniqueservice "itemd"
    skynet.call(redpacketd,"lua","init")

	skynet.dispatch("lua", function(_, session, cmd, ...)
        local f = CMD[cmd]
        if not f then
            skynet.error("gameserver no find cmd ",cmd)
            return
        end
        skynet.ret(skynet.pack(f(...)))
    end)
    skynet.register("gameserver")

end)
